const ctx = require.context('@', true, /views(\/\w*)*\/(routes\/index|routes)\.js$/i, 'sync')
const pageRoutes = () => {
  const result = []
  const paths = ctx.keys()
  paths.forEach(path => {
    const routes = ctx(path).routes || []
    result.push(...routes)
  })
  return result
}
export const routes = [...pageRoutes()]
